home *** CD-ROM | disk | FTP | other *** search
- global gDBTextVarList
-
- on ResizeLayOutScreen
- if the width of sprite 1 = 640 then
- size = 1
- else
- size = 2
- end if
- SizeWindowArt(size)
- EnableScroll = SizeText(size)
- SizeScroll(size)
- EvalDisableScroll(EnableScroll)
- SizeMIAW(size)
- updateStage()
- SetScrollHandler()
- end
-
- on SizeWindowArt size
- MyObj = getaProp(gDBTextVarList, GetObjProp())
- SetPuppetState([1, 3], #c, 1)
- BorderRect = GetBorderRect(MyObj, size)
- set the rect of sprite 1 to BorderRect
- set the rect of sprite 2 to BorderRect + rect(1, 1, -1, -1)
- xMemberNum = the number of member getAt(["doc min", "doc max"], size)
- set the member of sprite 3 to member(xMemberNum)
- set the rect of sprite 3 to rect(0, 0, member(xMemberNum).width, member(xMemberNum).height)
- SpriteList = GetSpriteList(MyObj)
- ButtonList = GetButtonList(MyObj)
- repeat with rc in ButtonList
- buttonLoc(rc, size)
- end repeat
- end
-
- on SizeText size
- MyObj = getaProp(gDBTextVarList, GetObjProp())
- EnableScroll = 0
- SpriteList = GetSpriteList(MyObj)
- TextSprite = getaProp(SpriteList, #text)
- xMember = the member of sprite TextSprite
- xRect = GetTextRect(MyObj, size)
- member(xMember).rect = xRect
- if member(xMember).height > (GetRectHeight(xRect) + 7) then
- EnableScroll = 1
- end if
- set the loc of sprite TextSprite to point(getAt(xRect, 1), getAt(xRect, 2))
- member(xMember).scrollTop = 0
- ResetSelections(MyObj)
- return EnableScroll
- end
-
- on SizeScroll size
- MyObj = getaProp(gDBTextVarList, GetObjProp())
- SpriteList = GetSpriteList(MyObj)
- TextSprite = getaProp(SpriteList, #text)
- xMember = the member of sprite TextSprite
- OutSideRect = GetBorderRect(MyObj, size) + rect(0, 0, -2, -1)
- InnerRect = GetInsideRect(2, OutSideRect)
- TextRect = GetTextRect(MyObj, size)
- NArrowSp = getaProp(SpriteList, #NArrow)
- SArrowSp = getaProp(SpriteList, #SArrow)
- ThumbSp = getaProp(SpriteList, #VThumb)
- sL = getAt(InnerRect, 3) - the width of sprite NArrowSp
- sT = getAt(TextRect, 2)
- sR = getAt(InnerRect, 3)
- sB = getAt(InnerRect, 4)
- set the rect of sprite getaProp(SpriteList, #VBed) to rect(sL, sT, sR, sB)
- set the rect of sprite NArrowSp to rect(sL, sT, sR, sT + the height of sprite NArrowSp)
- set the rect of sprite SArrowSp to rect(sL, sB - the height of sprite SArrowSp, sR, sB)
- thumbTop = sT + the height of sprite NArrowSp
- set the rect of sprite ThumbSp to rect(sL, thumbTop, sR, thumbTop + (the member of sprite ThumbSp).height)
- ThumbXLoc = (sR - sL) / 2
- ThumbMin = thumbTop + ((the member of sprite ThumbSp).height / 2)
- ThumbMax = sB - the height of sprite SArrowSp - (the height of sprite ThumbSp / 2)
- numLines = member(xMember).lineCount
- numVisLines = GetRectHeight(TextRect) / the textHeight of member xMember
- numSettings = numLines - numVisLines + 1
- ResizeScroll(MyObj, ThumbXLoc, ThumbMin, ThumbMax, 1, numSettings, 1, numSettings)
- end
-
- on SizeMIAW size
- if count(the windowList) > 0 then
- MyObj = getaProp(gDBTextVarList, GetObjProp())
- windowName = (the activeWindow).name
- MyRect = window(windowName).rect
- if size = 1 then
- l = getAt(MyRect, 1)
- t = getAt(MyRect, 2)
- else
- l = getAt((the stage).rect, 1)
- t = getAt((the stage).rect, 2) + 26
- end if
- window(windowName).rect = GetBorderRect(MyObj, size) + rect(l, t, l, t)
- end if
- end
-